1. Technical Field
The present disclosure relates to an image forming apparatus, a computer readable recording medium and a method for improving the detection of input image data formats.
2. Description of the Related Art
As typical data formats of image data (print data) that an image forming apparatus having a printing function such as a printer, an MFP (Multi Functional Peripheral), or the like is capable of interpreting, PDL (Page Description Language) formats such as, for example, PS (PostScript), PCL (Printer Control Language), and the like are used.
The number of image forming apparatus of the type that use electronic document formats such as PDF (Portable Document Format) and XPS (XML Paper Specification), and mark-up languages such as HTML (HyperText Markup Language) and XML (Extensible Markup Language), as data formats of the input image data (print data) is increasing.
In an image forming apparatus that is capable of using image data of many data formats as mentioned above, a control code inherent to a vendor is embedded in the image data specifies the PDL format of the image data, or a user specifies the PDL format by operating the console of the image forming apparatus.
In addition, there is a technique that causes an image forming apparatus to analyze the header of received input image data to specify the PDL format of the input image data.
FIG. 10 is a flowchart illustrating an example of a method of specifying one of the XPS format, the TIFF (Tagged Image File Format) format, and the PS (PostScript) format as a data format of input image data.
As illustrated in FIG. 10, first, the header part of the input image data is read (step S101). Then, if the header part is 0x504B0304 (“PK . . . ” in the ASCII character set) (step S102), it is interpreted that the input image data is of the XPS format (step S103). Or, if the header part is 0x4D4D002A (“MM . . . ” in the ASCII character set) or 0x49492A00 (“II . . . ” in the ASCII character set) (step S104), it is interpreted that the input image data is of the TIFF format (step S105). Or, if the header part is “%!PS” (step S106), it is interpreted that the input image data is of the PS format (step S107). On the other hand, if the header part does not have any of the above mentioned identification codes, specification of the data format of the input image data is impossible and hence error processing is executed (step S108). As a result, the input image data is interpreted to be of the specified data format and a drawing processing is executed on the basis of the interpretation (step S109) and raster data for use in printing is generated.
In the case that the data format of the input image data is automatically specified on the basis of only the code of the header part of the input image data as described above, if the header part of the input image data is not correctly described or the header part is broken in the course of communication, error processing may be executed when the input image data is interpreted.
In addition, if the header part of text data or binary data (that is, data that will never be input image data) to which the image forming apparatus does not conform unexpectedly matches the header part of the input image data to which the image forming apparatus conforms, the data may be incorrectly interpreted as the input image data. As a result, a large number of pages of meaningless data may be printed or an unexpected malfunction may be generated.